{{include file ="admin/header.tpl"}}
{{include file ="admin/navibar.tpl"}}
{{include file ="admin/sidebar.tpl"}}
<script src="{{$smarty.const.WEBSITE_URL}}/public/assets/highcharts3/js/highcharts.js"></script>
<script src="{{$smarty.const.WEBSITE_URL}}/public/assets/highcharts3/js/modules/exporting.js"></script>
<script language="javascript">
$(function () {
$('#postreporte').highcharts({
chart: {
type: 'line'
},
title: {
text: '近期变化统计'
},
subtitle: {
text: '文章，文章评论'
},
xAxis: {
categories: [
    {{foreach from=$neardata item=data}}
    '{{$data[0]}}',
    {{/foreach}}
]
},
yAxis: {
title: {
text: '数量'
}
},
tooltip: {
enabled: true,
formatter: function() {
return '<b>'+ this.series.name +'</b><br/>'+
this.x +': '+ this.y ;
}
},

plotOptions: {
line: {
dataLabels: {
enabled: true
},
enableMouseTracking: false
}
},
series: [{
name: '文章',
data: [  {{foreach from=$neardata item=data}}
    {{$data[1]}},
    {{/foreach}}]
}, {
name: '评论',
data: [  {{foreach from=$neardata item=data}}
    {{$data[2]}},
    {{/foreach}}]
}]
});



    $('#userreporte').highcharts({
        chart: {
            plotBackgroundColor: null,
            plotBorderWidth: null,
            plotShadow: false
        },
        title: {
            text: '注册用户来源'
        },
        tooltip: {
            pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
        },
        plotOptions: {
            pie: {
                allowPointSelect: true,
                cursor: 'pointer',
                dataLabels: {
                    enabled: true,
                    color: '#000000',
                    connectorColor: '#000000',
                    format: '<b>{point.name}</b>: {point.percentage:.1f} %'
                }
            }
        },
        series: [{
            type: 'pie',
            name: '用户来源',
            data: [
                ['本站注册',{{$usercount->type0}}],
                {
                    name: '其它',
                    y: {{$usercount->type2}},
                    sliced: true,
                    selected: true
                },
                ['新浪微博',{{$usercount->type1}}]
            ]
        }]
    });
});

</script>
<div class="content">
    <div class="header">
        <div class="stats">
            <p class="stat"><!--span class="number"></span--></p>
        </div>
        <h1 class="page-title">系统统计信息</h1>
    </div>
    <div class="row-fluid">
        <div class="block">
            <a href="#page-stats" class="block-heading" data-toggle="collapse">任务统计</a>
            <div id="page-stats" class="block-body collapse in">
                <div class="stat-widget-container">
                    <div class="stat-widget">
                        <div class="stat-button">
                            <p class="title">{{$datacount->postcount}}</p>
                            <p class="detail">文章总数</p>
                        </div>
                    </div>
                    <div class="stat-widget">
                        <div class="stat-button">
                            <p class="title">{{$datacount->commentscount}}</p>
                            <p class="detail">评论总数</p>
                        </div>
                    </div>

                    <div class="stat-widget">
                        <div class="stat-button">
                            <p class="title">{{$datacount->usercount}}</p>
                            <p class="detail">用户总数</p>
                        </div>
                    </div>

                    <div class="stat-widget">
                        <div class="stat-button">
                            <p class="title">{{$datacount->tagcount}}</p>
                            <p class="detail">标签总数</p>
                        </div>
                    </div>

                </div>
            </div>
        </div>
    </div>
    <div class="row-fluid">
            <div class="block span6">
                <a href="#tablewidget" class="block-heading" data-toggle="collapse">监控报表</a>
                <div id="postreporte" class="block-body collapse in">

                </div>
            </div>
            <div class="block span6">
                <a href="#widget1container" class="block-heading" data-toggle="collapse">监控报表 </a>
                <div id="userreporte" class="block-body collapse in">

                </div>
            </div>
        </div>
         <!-- END 以下内容不需更改，请保证该TPL页内的标签匹配即可 -->
{{include file="admin/footer.tpl" }}